package kr.hkit.powerjava.chapter22.work2;

import java.util.ArrayList;

import kr.hkit.powerjava.chapter22.work2.Dao.DepartmentMeneger;
import kr.hkit.powerjava.chapter22.work2.Vo.Department;

public class TestMain {
	public static void main(String[] args) {
		ArrayList<Department> dptList = new ArrayList<>();
		DepartmentMeneger dpt = new DepartmentMeneger(dptList);

		// add
		Department dpt1 = new Department(1, "Java", 2);
		dpt.addItem(dpt1);
		Department dpt2 = new Department(2, "DB", 2);
		dpt.addItem(dpt2);
		dpt.addItem(new Department(3, "UML", 2));
		dpt.addItem(new Department(4, "JSP", 2));

		// del
		dpt.delItem(dpt2);

		// re
		Department updateItem = new Department(1, "Java", 63);
		dpt.updateItem(updateItem);

		// search
		boolean isSearch = dpt.searchItem(new Department(1, "Java"));

		// prn
		dpt.prnItem();

		/*
		 * ArrayList<Student> stdList = new ArrayList<>(); StudentMenegerImp sm
		 * = new StudentMenegerImp(stdList);
		 * 
		 * //추가 Student std1 = new Student(1, "김태희", 90, 90, 90);
		 * sm.addItem(std1); Student std2 = new Student(2, "제시카", 92, 93, 94);
		 * sm.addItem(std2); sm.addItem(new Student(3, "김주하", 80, 80, 80));
		 * sm.addItem(new Student(4, "김민정", 79, 79, 89));
		 * 
		 * //삭제 //sm.delItem(std1);
		 * 
		 * //수정 Student updateItem = new Student(1, "김태희", 91, 93, 94);
		 * sm.updateItem(updateItem);
		 * 
		 * //검색 boolean isSearch = sm.searchItem(new Student(1, "김태희"));
		 * System.out.println(isSearch);
		 * 
		 * //출력 System.out.println("국어점수 정렬(내림차순)"); sm.prnItems(new
		 * Comparator<Student>() {
		 * 
		 * @Override public int compare(Student o1, Student o2) { return
		 * o2.getKor() - o1.getKor(); } });
		 */

	}
}
